package bb.lanxing.util;

import android.app.Activity;

import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;

public class InstallerUtil {
    public static final int APP_QQ = 2;
    public static final int APP_QZONE = 3;
    public static final int APP_SINA = 4;
    public static final int APP_WECHAT = 1;

    public static boolean isAppInstalled(Activity activity, int i) {
        return switch (i) {
            case APP_WECHAT -> UMShareAPI.get(activity).isInstall(activity, SHARE_MEDIA.WEIXIN);
            case APP_QQ -> UMShareAPI.get(activity).isInstall(activity, SHARE_MEDIA.QQ);
            case APP_QZONE -> UMShareAPI.get(activity).isInstall(activity, SHARE_MEDIA.QZONE);
            case APP_SINA -> UMShareAPI.get(activity).isInstall(activity, SHARE_MEDIA.SINA);
            default -> false;
        };
    }
}